package com.workerhelping.enums;

import lombok.Getter;

@Getter
public enum IncomeCategoryEnum {
    LIFE(1, "生活救助类"),
    MEDICAL(2, "医疗救助类"),
    CHILD(3, "子女助学类"),
    LAW(4, "下岗补助类"),
    OTHERS(5, "其他类"),
    ;

    private final Integer code;
    private final String category;

    IncomeCategoryEnum(Integer code, String category) {
        this.code = code;
        this.category = category;
    }

    public static String getCategoryName(Integer code) {
        if (code==1)
            return LIFE.category;
        else if (code==2)
            return MEDICAL.category;
        else if (code==3)
            return CHILD.category;
        else if (code==4)
            return LAW.category;
        else if (code==5)
            return OTHERS.category;
        else return null;
    }
}
